package view;

/**
 * @author Andrea
 * 
 */
import java.util.ResourceBundle;

import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;

public class OutputArea {
	// Load resource bundles
	private static ResourceBundle myViewLabels = ResourceBundle
			.getBundle("resources.englishView");
	private static ResourceBundle myViewSizes = ResourceBundle
			.getBundle("resources.viewSizes");

	private static JTextArea outputBox;

	// private boolean outputEmpty = true;
	// private String newline = "\n";

	public JTextArea createOutputTextArea() {
		// Make the output box (by calling makeTextField)
		GeneralTextArea out = new GeneralTextArea();
		outputBox = out.makeTextField(myViewLabels.getString("OutputPanel"),
				Integer.parseInt(myViewSizes.getString("OutputFieldRows")),
				ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, false);
		return outputBox;
	}

	// Displays the answer to a user's request in the output box
	public static void updateOutputBox(String message) {
		/*
		 * if (outputEmpty == true) { outputBox.setText(message); outputEmpty =
		 * false; } else { outputBox.append(newline + message); }
		 */

		outputBox.setText(message);
	}
}
